#!/bin/sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install 20.11.1
nvm use 20.11.1
npm i pnpm -g --registry=http://nexus.17usoft.com/repository/npm-all/
pnpm i --registry=http://nexus.17usoft.com/repository/npm-all/
pnpm run build:stage
echo '===== SHOW RESOURCE FOLDER ====='
ls -alt ../resources/static
echo '===== DELETE RESOURCE FOLDER ====='
rm -rf ../resources/static
echo '===== SHOW RESOURCE FOLDER AGAIN ====='
ls -alt ../resources/static
echo '===== SHOW DIST FOLDER ====='
ls -alt ./dist/
echo '===== COPY RESOURCE FROM DIST ====='
cp -rf ./dist/ ../resources/static
echo '===== SHOW RESOURCE FOLDER ====='
ls -alt ../resources/static